{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a68b5c52-ce4f-4eb4-833e-1b670a948325",
   "metadata": {},
   "outputs": [],
   "source": [
    "# -*- coding: utf-8 -*-\n",
    "\"\"\"\n",
    "Created on Fri Oct 22 16:32:43 2021\n",
    "\n",
    "@author: lx\n",
    "\"\"\"\n",
    "import jieba\n",
    "text = \"国庆期间去广州看了小蛮腰，希望有机会登上塔顶。\"\n",
    "seg = jieba.cut(text,cut_all=False)\n",
    "print('精确模式：'+'/'.join(seg))\n",
    "seg = jieba.lcut(text,cut_all=False)\n",
    "print(seg)\n",
    "seg = jieba.cut(text,cut_all=True)\n",
    "print('全模式：'+'/'.join(seg))\n",
    "seg = jieba.lcut(text,cut_all=True)\n",
    "print(seg)\n",
    "seg = jieba.cut_for_search(text)\n",
    "print('搜索引擎模式：'+'/'.join(seg))\n",
    "seg = jieba.lcut_for_search(text)\n",
    "print(seg)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "11875a99-b181-44aa-8bfd-28e94f940135",
   "metadata": {},
   "outputs": [],
   "source": [
    "pip install jieba"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
